/*
 * Lenovo Group
 * Copyright (c) 2015-2016 All Rights Reserved.
 * 
 * Project Name:lmrp-api
 * Create Time: 2016年2月19日 下午9:07:35
 */
package com.lenovo.lmrp.api.model.entity;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 
 * @author wujin
 * @version v1.0
 */
@Entity
@Table(name = "lmrp_process")
public class ProcessPO {

    public static enum ProcessStatus {
        //-- 0 - 待发布，1 - 已发布，2 - 已禁用, 3 - 已更新，4 - 待删除
        UNPUBLISHED,
        PUBLISHED,
        DISABLED,
        DELETING;
    }

    @Id
    @Column
    private String processId;

    @Column
    private String parentId;

    @Column
    private String itsmCode;

    @Column
    private String name;

    @Column
    private String processKey;

    @Column
    private String bpmnFilePath;

    @Column
    private String processForm;

    @Column
    private Date createTime;

    @Column
    private Date updateTime;

    @Column
    private String description;

    @Enumerated(EnumType.ORDINAL)
    @Column
    private ProcessStatus status;

    @Column
    private Boolean mainFlag;

    @Transient
    private List<ProcessActivityPO> activitys;

    /**
     * Generated after deploy to activiti engine
     * 
     * @return
     */
    public String getProcessId() {
        return processId;
    }

    public void setProcessId(String processId) {
        this.processId = processId;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getItsmCode() {
        return itsmCode;
    }

    public void setItsmCode(String itsmCode) {
        this.itsmCode = itsmCode;
    }

    /**
     * extract from bpmn file
     * 
     * @return
     */
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * Key and itsmcode should keep unique, key is extracted from bpmn file
     * 
     * @return
     */
    public String getProcessKey() {
        return processKey;
    }

    public void setProcessKey(String processKey) {
        this.processKey = processKey;
    }

    /**
     * saved original BPMN file, path format is ROOT_PATH/itsmcode/workflow/bpmnfilename
     * 
     * @return
     */
    public String getBpmnFilePath() {
        return bpmnFilePath;
    }

    public void setBpmnFilePath(String bpmnFilePath) {
        this.bpmnFilePath = bpmnFilePath;
    }

    /**
     * A process associate with a HTML form which show process diagram
     * 
     * @return
     */
    public String getProcessForm() {
        return processForm;
    }

    public void setProcessForm(String processForm) {
        this.processForm = processForm;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public ProcessStatus getStatus() {
        return status;
    }

    public void setStatus(ProcessStatus status) {
        this.status = status;
    }

    public List<ProcessActivityPO> getActivitys() {
        return activitys;
    }

    public void setActivitys(List<ProcessActivityPO> activitys) {
        this.activitys = activitys;
    }

    public Boolean getMainFlag() {
        return mainFlag;
    }

    public void setMainFlag(Boolean mainFlag) {
        this.mainFlag = mainFlag;
    }

}
